package cn.com.artemis.biz.steinsggs.common.type;

import java.util.HashMap;
import java.util.Map;

/**
 * Created by xuyulin on 2017/8/25.
 */
public enum OperateType {
    Account_Created(1, "Account Created"),
    TRADE_BUY(2, "TRADE BUY"),
    TRADE_SELL(3, "TRADE SELL");

    private int id;
    private String desc;

    private static final Map<Integer, OperateType> instancesMap = new HashMap<Integer, OperateType>();


    public static OperateType getInstance(int id) {
        return instancesMap.get(id);
    }

    private OperateType(int id, String desc) {
        this.id = id;
        this.desc = desc;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }

    static {
        for (OperateType ot:
             OperateType.values()) {
            instancesMap.put(ot.getId(), ot);
        }
    }


}
